﻿using Core.Migrations.Extensions;
using FluentMigrator;

namespace BP.Plugin.Monitor.Infrastructure.Persistence.Migrations.OnlineUsers;

[Migration(202511091429)]
public class AlterColumnToNullable : ForwardOnlyMigration
{
    public override void Up()
    {    
        Alter.Column("UserId")
            .OnTable("OnlineUsers").InSchema(SchemaNames.Monitor)
            .AsGuid().Nullable();

        Alter.Column("UserName")
           .OnTable("OnlineUsers").InSchema(SchemaNames.Monitor)
           .AsString(100).Nullable();

         Alter.Column("LoginTime")
           .OnTable("OnlineUsers").InSchema(SchemaNames.Monitor)
           .AsDateTimeOffset().Nullable();

        Alter.Column("LastActiveTime")
           .OnTable("OnlineUsers").InSchema(SchemaNames.Monitor)
           .AsDateTimeOffset().Nullable();
    }
}
